<?php

use Faker\Generator as Faker;

$factory->define(\App\Models\Cafe::class, function (Faker $faker) {
    $companyIds = \App\Models\Company::query()->pluck('id');
    $userIds = \App\Models\User::pluck('id');
    return [
        'name'        => $faker->word,
        'description' => $faker->sentence,
        'state'       => $faker->state,
        'city'        => $faker->city,
        'address'     => $faker->streetAddress . $faker->buildingNumber,
        'zip'         => $faker->postcode,
        'latitude'    => $faker->latitude,
        'longitude'   => $faker->longitude,
        'tea'         => $faker->boolean,
        'matcha'      => $faker->boolean,
        'company_id'  => $faker->randomElement($companyIds),
        'added_by'    => $faker->randomElement($userIds)
    ];
});
